# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 9:29
# @Author  : 刘张宇
# @Email   : 2285524065@qq.com
# @File    : .py
# @Software: PyCharm

from appium.webdriver.common.mobileby import MobileBy as By
from pages.base_page import BasePage

class Orders(BasePage):
    orders_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/dt_order"]')#订单定位器
    all_locator = (By.XPATH, '//*[@resource-id="com.xiachufang:id/tablayout"]/android.widget.LinearLayout[1]/androidx.appcompat.app.ActionBar-Tab[1]')#全部定位器
    title_locator = (By.XPATH, '//*[@text="全部"]')

    def menu_orders(self):
        self.find_element(self.orders_locator).click()#点击订单

    def menu_all(self):
        self.find_element(self.all_locator).click()#点击全部

    def task_first(self):
        current_task = self.find_element(self.title_locator).text
        return current_task